package org.ekstrabilet.stadium.beans;

import java.util.ArrayList;

import org.ekstrabilet.stadium.logic.SectorLogic;

/**
 * 
 * @author Maciej Koch
 *
 */
public class Sector extends PhysicalObject{
	
	private ArrayList<Row> rows = new ArrayList<Row>();
	private int capacity;
	private int price;
	private char sign;
	private int sectorId;
	private int rowsNum;
	private int seatsNum;

	public char getSign() {
		return sign;
	}

	public void setSign(char sign) {
		this.sign = sign;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}
	
	public ArrayList<Row> getRows() {
		if(rows.isEmpty()){
			SectorLogic logic= SectorLogic.getInstance();
			rows= logic.getRows(this); 
		}
		return rows;
	}

	public void setRows(ArrayList<Row> rows) {
		this.rows = rows;
	}
	
	public Row getRow(int i) {
		if(i < 0 || i >= rows.size())
			return null;
		return rows.get(i);
	}

	public void addRow(Row r) {
		this.rows.add(r);
	}

	public int getSectorId() {
		return sectorId;
	}

	public void setSectorId(int sectorId) {
		this.sectorId = sectorId;
	}

	public void setRowsNum(int rowsNum) {
		this.rowsNum = rowsNum;
	}

	public void setSeatsNum(int seatsNum) {
		this.seatsNum = seatsNum;
	}

	public int getRowsNum() {
		return rowsNum;
	}

	public int getSeatsNum() {
		return seatsNum;
	}
	
	
	
	
}
